﻿using System.Collections.Generic;
using BBCode.Nodes;
using BBCode.Template;

namespace BBCode.Tags
{
    //Default interface
    /// <summary>
    /// ITag interface used by most tags.
    /// </summary>
    public interface ITag : ITag<INode>
    {
    }

    //Generic interface
    /// <summary>
    /// Interface that All tags inherit.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ITag<T>
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets the name of the template.
        /// </summary>
        /// <value>
        /// The name of the template.
        /// </value>
        string TemplateName { get; }

        /// <summary>
        /// Gets a value indicating whether this instance can have children.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance can have children; otherwise, <c>false</c>.
        /// </value>
        bool CanHaveChildren { get; }

        /// <summary>
        /// Gets or sets the type of the parse.
        /// </summary>
        /// <value>
        /// The type of the parse.
        /// </value>
        ParseType ParseType { get; set; }

        /// <summary>
        /// Gets the priority.
        /// </summary>
        int Priority { get; }

        /// <summary>
        /// Gets the nodes.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <returns>The found nodes.</returns>
        IEnumerable<T> GetNodes(string text);

        /// <summary>
        /// Gets the template.
        /// </summary>
        /// <returns></returns>
        NVTemplate GetTemplate();
    }
}